package com.house.user.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * TRoleRight entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_role_right")
public class TRoleRight implements java.io.Serializable {

	// Fields

	private Integer roleRightId;
	private Role role;
	private Right right;
	private String rightType;

	// Constructors

	/** default constructor */
	public TRoleRight() {
	}

	/** full constructor */
	public TRoleRight(Role role, Right right, String rightType) {
		this.role = role;
		this.right = right;
		this.rightType = rightType;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "role_right_id", unique = true, nullable = false)
	public Integer getRoleRightId() {
		return this.roleRightId;
	}

	public void setRoleRightId(Integer roleRightId) {
		this.roleRightId = roleRightId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "role_id", nullable = false)
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "right_id", nullable = false)
	public Right getRight() {
		return this.right;
	}

	public void setRight(Right right) {
		this.right = right;
	}

	@Column(name = "right_type", nullable = false, length = 2)
	public String getRightType() {
		return this.rightType;
	}

	public void setRightType(String rightType) {
		this.rightType = rightType;
	}

}